document.write("<script type='text/javascript' src='/statics/js/modules/demo/test.vue'></script>");
var demoVu =new Vue({
    el:'#zyDemo',
    data:{
        testData: null,
        optionList:[{'name':'java', 'value':'java'},{'name':'c', 'value':'c'},{'name':'c++', 'value':'c++'}],
        formData:{"test":"c++","test2":[], "flag":true,date:''},
        text:"1234556"
    },
    methods:{
        changeData: function (e) {
            ;
            alert(e.constructor());
        },
        buttonClick: function(){
        	console.log(1234);
        	$.ajax({
                type: "GET",
                url: baseURL + "demo/test",
                contentType: "application/json",
                data: null,
                success: function(r){
                    console.log(r);
                }
            });
        	
        }
    },
})


// 注册下拉选择框
Vue.component('select2', {
    props: ['options', 'value'],
    template: '<select><slot></slot></select>',
    mounted: function () {
        var vm = this;// init select2
        $(this.$el).select2({ data: this.options }).val(this.value).trigger('change').on('change', function () {
            // emit event on change.
            vm.$emit('input', this.value)
        })
    },
    watch: {
        value: function (value) {
            // update value
            $(this.$el).val(value).trigger('change')
        },
        options: function (options) {
            // update options
            $(this.$el).empty().select2({ data: options })
        }
    },
    destroyed: function () {
        $(this.$el).off().select2('destroy')
    }
})

var vm = new Vue({
    el: '#el',
    data: {
        selected: 2,
        options: [
            { id: 0, text: '苹果' },
            { id: 1, text: '香蕉' },
            { id: 2, text: '香梨' },
            { id: 3, text: '榴莲' },
            { id: 4, text: '西瓜' }
        ]
    }
})



$(function () {
    //switch 组件
    $('.switch ').bootstrapSwitch({
        onText:"开",
        offText:"关",
        //onColor: "success", //打开左侧颜色
        //offColor: "info",//关闭右侧颜色
        size: "small",// 图标大小
        onSwitchChange: function (event, state) {
            console.log(state);
        }
    });


    //下载组件
    $.files_up_oss({
        id: ["upload", "upload1"],//按钮id
        url: "/sys/oss/getSignature",
        dir: "test111/",
        file_type: "jpg,png,gif,psd,ai,cdr,eps,ppt,word,excel,pdf,tiff,rar,zip,7z",
        size: "100mb",//mb
        view_url: window.parent.vm.ossHost
    }, function (index_number, json) {
        //定义自己的回调函数
        console.log(index_number, json)
    });

    CKEDITOR.replace('editor1')
    // $('.textarea').wysihtml5()

    // jquery.qrcode   二维码
    // jQuery('#qrcode').qrcode("http://blog.csdn.net/mr_smile2014");
    jQuery('#qrcode').qrcode({
        width: 100,
        height: 100,
        text: "123456"
    });
})